home *** CD-ROM | disk | FTP | other *** search
- ; DESC; Writes to a data file V1.00
- ; IN: *{HANDLE} handle of file
- ; *{NUM_BYTES} number of bytes to write
- ; *{SEG_VAL} segment and
- ; *{OFFSET} offset of buffer
- ; OUT: *{OUT_BYTES} number of bytes actually written
- ; SAMPLE: Callm WRITE,<HANDLE,NUM_BYTES,SEG_VAL,OFFSET>,<OUT_BYTES>
- ; ###################################################################
-
- Extrn PUSHALL:Near
- Extrn POPALL:Near
- Extrn ERRORMSG:Near
-
- WRITEC Segment
- Assume CS:WRITEC
- Public WRITE
-
- ;notice.
- DB 'WRITE - V1.00, Copyright 1987, CoreTechs ',0DH,0AH
-
- WRITE Proc Near ;writes a file.
-
- Call PUSHALL
-
- Pop DX ;get buffer offset.
- Pop DS ;get buffer segment.
- Pop CX ;get number of bytes to write.
- Pop BX ;get the handle.
-
- Mov AH,40H ;write a file.
- Int 21H
- Jc ERROR ;if an error report it.
-
- Push AX
- Call POPALL
- Ret
-
- ERROR: Push AX ;report error and abort.
- Call ERRORMSG
-
- WRITE Endp
- WRITEC Ends
- End